/*
 * Copyright (c) 2018 - 2028. www.vtuzx.com Inc. All Rights Reserved
 */
package com.vtuzx.kingdee.xqc_api.service;

import com.vtuzx.core.VtuzxException;
import com.vtuzx.core.bean.dto.VtuzxMap;
import com.vtuzx.web.bean.VtuzxDownloadBean;
import org.bson.types.ObjectId;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * 外部接口服务
 */
public interface IXqcIfService {

    /**
     * 绑定箱号和RFID
     *
     * @param boxNo 箱号
     * @param rfid RFID
     * @param timestamp 时间戳
     * @param sign 签名
     * @param checkSignOnly 只签名
     */
    void bindBoxRfid(String boxNo, String rfid, long timestamp, String sign, boolean checkSignOnly) throws VtuzxException;

    /**
     * 保存RFID通过履历
     *
     * @param type 类型
     * @param palletRfid 托盘RFID
     * @param rfids RFID
     * @param timestamp 时间戳
     * @param sign 签名
     * @param checkSignOnly 只签名
     */
    void recordRfidInOut(String type, String palletRfid, List<String> rfids, long timestamp, String sign, boolean checkSignOnly) throws VtuzxException;

    /**
     * 根据箱号获取物料信息
     *
     * @param boxNo 箱号
     * @param timestamp 时间戳
     * @param sign 签名
     * @param checkSignOnly 只签名
     * @return 绑定结果
     */
    VtuzxMap getMaterialByBox(String boxNo, long timestamp, String sign, boolean checkSignOnly) throws VtuzxException;


    void trayInventory(List<String> rfidList, long timestamp, String sign, String ip, boolean checkSignOnly,boolean highlight) throws VtuzxException;

    void boxNoBindTray(Map<String, Object> param) throws VtuzxException;

    void boxNoBindTraceBack(Map<String, Object> param) throws VtuzxException;

    void updateStockData(Map<String, Object> param);

    ModelAndView traceabilityHistory(Map<String, Object> p, HttpServletRequest req) throws VtuzxException;

    VtuzxMap getTraceabilityHistoryList(ObjectId userId, String name, Map<String, Object> param);

    VtuzxMap setNoPrintBoxNoFlag(Map<String, Object> param) throws VtuzxException;

    VtuzxMap getNoPrintBoxNo(Map<String, Object> param) throws VtuzxException;

    /**
     * 根据经销商和时间返回对应的订单信息
     * @param param
     * @return
     * @throws VtuzxException
     */
    VtuzxMap getSaleByDealer(Map<String, Object> param) throws Exception;

    /**
     * 根据单据号返回对应单据信息，明细物料，还有对应物料的追溯信息
     * @param param
     * @return
     * @throws VtuzxException
     */
    VtuzxMap getSaleByTradeNo(Map<String, Object> param) throws Exception;

    //根据时间段查询包裹信息
    VtuzxMap getPackageList(Map<String,Object> param) throws Exception;



    //根据销售单号查询包裹
    VtuzxMap getPackageByOrderNo(Map<String,Object> param) throws Exception;

    Boolean bindingSerial(Map<String, Object> param) throws Exception;
}
